package com.qfmy.web.app.config;

import dev.langchain4j.memory.chat.ChatMemoryProvider;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.config
 * @date 2025/11/01
 * @description 聊天记忆提供者
 */
@Lazy
@Configuration
@SuppressWarnings("all")
public class SeparateChatAssistantConfig {

    /**
     * 聊天记忆提供者
     * @return
     */
    @Bean
    public ChatMemoryProvider chatMemoryProvider() {
        return memoryId -> MessageWindowChatMemory.builder().id(memoryId).maxMessages(10).build();
    }

}
